{layout name="admin:layout" /}
<div id="actionbar">
    <a href="{:url('system/admin.miniapp/add')}" class="button button-blue"><i class="iconfont icon-add_icon"></i>创建新应用</a>
</div>
<table class="table table-border">
<thead>
    <tr>
        <th class="w80"></th>
        <th>应用名称</th>
        <th class="w100 fn-tac">应用类型</th>
        <th class="w100 fn-tar">价格</th>
        <th class="w100 fn-tar">版本</th>
        <th class="w100 fn-tac">接入方式</th>
        <th class="w100 fn-tac">应用类型</th>
        <th class="w70 fn-tac">状态</th>
        <th class="w220 fn-tac">操作</th>
    </tr>
</thead>
<tbody>
{foreach $diff as $rs}
    <tr>
        <td class="fn-tac"><img class="w60" src="__STATIC__/{$rs['miniapp_dir']}/logo.png"  style="border-radius: 10px;"></td>
        <td>{$rs.name}<p class="gray">{$rs.describe}</p></td>
        <td class="fn-tac">
            {switch $rs.types}
            {case mp}<svg class="icon" aria-hidden="true"><use xlink:href="#icon-gonggaoxinxi"></use></svg> 公众号{/case}
            {case program}<svg class="icon" aria-hidden="true"><use xlink:href="#icon-xiaochengxu"></use></svg> 小程序{/case}
            {case app}APP{/case}
            {case mp_program}
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-xiaochengxu"></use></svg> 小程序<br />
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-gonggaoxinxi"></use></svg> 公众号{/case}
            {case mp_program_app}
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-xiaochengxu"></use></svg> 小程序<br />
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-gonggaoxinxi"></use></svg> 公众号<br />
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-yingyongyuanma"></use></svg> 轻应用
            {/case}
            {default /}<span class="badge">应用异常</span>
            {/switch}  
        </td>
        <td class="fn-tar"><sub>￥</sub>0.00</td>
        <td class="fn-tar">{$rs.version}</td>
        <td class="fn-tac">{if $rs.is_openapp}<span class="badge bg-green">独立应用</span>{else}<span class="badge">开放平台</span>{/if}</td>
        <td class="fn-tac">{if $rs.is_diyapp}<span class="badge bg-red">专属定制</span>{else}<span class="badge">公共应用</span>{/if}</td>
        <td class="fn-tac"><span class="badge bg-red">待安装</span></td>
        <td class="button-group">
            <a class="button button-disabled"><i class="iconfont icon-my_icon"></i>管理</a>
            <a class="button button-disabled"><i class="iconfont icon-edit"></i>设置</a>
            <a class="button button-red install" url="{:url('system/admin.miniapp/install',['dir' => $rs.miniapp_dir])}"  href="javascript:;"><i class="iconfont icon-add_icon"></i>安装</a>
        </td>
    </tr>
{/foreach}
{foreach $list as $rs}
    <tr>
        <td class="fn-tac">
            <a href="{:url('system/admin.miniapp/authorizar',['miniapp_id' => $rs->id])}">
                <img class="w60" src="__STATIC__/{$rs.miniapp_dir}/logo.png"  style="border-radius: 10px;">
            </a>
        </td>
        <td><a href="{:url('system/admin.miniapp/authorizar',['miniapp_id' => $rs->id])}">{$rs.title}</a><p class="gray">{$rs.describe}</p></td>
        <td class="fn-tac">
            {switch $rs.types}
            {case mp}<svg class="icon" aria-hidden="true"><use xlink:href="#icon-gonggaoxinxi"></use></svg> 公众号{/case}
            {case program}<svg class="icon" aria-hidden="true"><use xlink:href="#icon-xiaochengxu"></use></svg> 小程序{/case}
            {case app}APP{/case}
            {case mp_program}
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-xiaochengxu"></use></svg> 小程序<br />
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-gonggaoxinxi"></use></svg> 公众号{/case}
            {case mp_program_app}
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-xiaochengxu"></use></svg> 小程序<br />
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-gonggaoxinxi"></use></svg> 公众号<br />
            <svg class="icon" aria-hidden="true"><use xlink:href="#icon-yingyongyuanma"></use></svg> 轻应用
            {/case}
            {default /}<span class="badge">应用异常</span>
            {/switch}  
        </td>
        <td class="fn-tar"><sub>￥</sub>{$rs.sell_price}<br /><del class="gray"><sub>￥</sub>{$rs.market_price}</del></td>
        <td class="fn-tar">v{$rs.version}</td>
        <td class="fn-tac">{if $rs.is_openapp}<span class="badge bg-green">独立配置</span>{else}<span class="badge">扫码授权</span>{/if}</td>
        <td class="fn-tac">{if $rs.is_diyapp}<span class="badge bg-red">专属定制</span>{else}<span class="badge">公共应用</span>{/if}</td>
        <td class="fn-tac">
            <a class="isLock" url="{:url('system/admin.miniapp/islock',array('id'=>$rs.id))}" href="javascript:;" title="锁定/解锁">
            {if $rs.is_lock}<span class="badge bg-red">锁定</span>{else}<span class="badge">正常</span>{/if}</a>
        </td>
        <td class="button-group">
            {if $rs.is_manage}<a class="button isManage" href="javascript:;" url="{:url('system/admin.miniapp/manage',['id' => $rs->id])}" >
            {else}<a class="button button-disabled">{/if}<i class="iconfont icon-setup_icon"></i>管理</a>
            <a class="button" href="{:url('system/admin.miniapp/edit',['id'=>$rs->id])}"><i class="iconfont icon-edit"></i>设置</a>
            <a class="button isDel" url="{:url('system/admin.miniapp/delete',['id'=>$rs->id])}" href="javascript:;"><i class="iconfont icon-lajixiang"></i>删除</a>
        </td>
    </tr>
{/foreach}
</tbody>
</table>
<div class="page">{$list|raw}</div>
<script type="text/javascript">
Do('base','layer',function(){
    $('.isDel').isDel();
    $('.isLock').actUrl()
    $('.install').actUrl({'msg':'确定安装当前应用吗？'})
    $('.isManage').actUrl({'msg':'切换管理当前应用','parent':true});
})
</script>